<template>
    <view class="page">
        <!-- #ifdef MP-WEIXIN || MP-TOUTIAO -->
        <block v-for="(item,index) in 6" :key="index">
            <image class="analysisImg" :lazy-load="true" :src="'https://image.srea.org.cn/xcx/baogao/house-type-analysis-'+(index+1)+'.jpg'" mode="widthFix"></image>
        </block>
        <!-- #endif -->
        
        <!-- #ifdef MP-BAIDU -->
        <block v-for="(item,index) in list" :key="index">
            <image class="analysisImg" :lazy-load="true" :src="item.image" mode="widthFix"></image>
        </block>
        <!-- #endif -->
    </view>
</template>

<script>
    import { mapState, mapActions } from 'pinia';
    import { useConfigStore, useUserInfoStore } from '@/store/index';
    // import { dispatchClient } from '@/common/api-adviser';
    import { isBoolean } from '@/common/common';
    export default {
        data(){
            return {
                pid: '',
                title: '',
                share: false,
                start_time: 0,
                list: [{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-1.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-2.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-3.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-4.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-5.jpg'
                },{
                    image: 'https://image.srea.org.cn/xcx/baogao/house-type-analysis-6.jpg'
                }]
            }
        },
        computed:{
        	...mapState(useUserInfoStore, ['userInfo'])
        },
        onShareAppMessage(res) {
            return {
                title: `【户型解析】点击了解详情`,
                path: `/pages/menus/tools/house-type/analysis?productId=${this.pid}&puid=${this.userInfo.id}&title=${this.title}&share=true&prepage=户型解析-${this.pid}-${this.title}`,
            }
        },
        onLoad(options) {
            const that = this;
            let {productId='', title='', puid='', share=false } = options;
            this.pid = productId&&productId!=='undefined'?productId:'';
            this.title = title&&title!=='undefined'?title:'';
            this.share = isBoolean(share);
            this.start_time = (new Date()).getTime();
            if(puid&&puid!=='undefined') {
                this.setPuid(puid)
            }
            
            uni.$check_and_login(function () {
                //绑定客户
                // dispatchClient({
                //     share: that.share,
                //     puid: puid,
                //     pid: that.pid
                // });
            })
        },
        methods: {
        	...mapActions(useConfigStore, ['setPuid'])
        }
    }
</script>

<style scoped lang="scss">
    .page{
        .analysisImg{
            width: 100%;
        }
    }
</style>
